﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace 设计模式.备忘录模式
{
    public class CareTaker
    {
        public List<Memento> mementos = new List<Memento>();
        public void Add(Memento state)
        {
            mementos.Add(state);
        }

        public Memento Get(int index)
        {
            return mementos[index];
        }

        public Memento this[int index]
        {
            get
            {
                return Get(index);
            }
        }
    }
}
